package tgc.edu.yzy.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import com.fasterxml.jackson.annotation.JsonIgnore;

import tgc.edu.yzy.custom.CommonEntityId;
@Entity
public class Book extends CommonEntityId{
	private String isbn;//图书的唯一标识
	private String name;//图书的名称
	private String press;//图书的出版社
	private String author;//图书的作者
	private Integer number;//图书数量（用来查看数据库有几本书）
	
	private String uuid;//图片的uuid
	private String filename;//图片的名称
	
	private Integer loan;//用来查询剩余基本可借的图书
	private Integer state;//用来储存状态  用户借书-----审核过程
	@JsonIgnore
	private List<BookRecord> bookrecord=new ArrayList<>();
	
	@Column(length=80,unique=true,nullable=false)
	public String getIsbn() {
		return isbn;
	}
	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}
	@Column(length=10)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(length=50)
	public String getPress() {
		return press;
	}
	public void setPress(String press) {
		this.press = press;
	}
	@Column(length=20)
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	@Column(length=11)
	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	@Column(length=150)
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	@Column(length=50)
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	@Column(length=11)
	public Integer getLoan() {
		return loan;
	}
	public void setLoan(Integer loan) {
		this.loan = loan;
	}
	@Column(length=11)
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	@OneToMany(cascade=CascadeType.ALL,mappedBy="book")
	public List<BookRecord> getBookrecord() {
		return bookrecord;
	}
	public void setBookrecord(List<BookRecord> bookrecord) {
		this.bookrecord = bookrecord;
	}
	
	
	
}
